<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>导航浮动</title>
    <style>
        *{
            margin: 0 auto;
            padding: 0 auto;
        }
        div{
            width: 674px;
            height: 50px;
            background: #ffc0cb;
        }
        div a{
            height: 50px;
            width: 80px;
            display: inline-block;
            text-decoration: none;
            font-size: 16px;
            color: white;
            text-align: center;
            line-height: 50px;
        }
        div a:hover{
            background-color: #008000;
        }
    </style>
</head>
<body>
    <div>
        <a href="#">新闻1</a>
        <a href="#">新闻2</a>
        <a href="#">新闻3</a>
        <a href="#">新闻4</a>
        <a href="#">新闻5</a>
        <a href="#">新闻6</a>
        <a href="#">新闻7</a>
        <a href="#">新闻8</a>
    </div>
</body>
</html>